class User {
    fullName: string;
    firstName: string;
    lastName: string;
    constructor(firstName: string, lastName: string) {
        this.firstName = firstName;
        this.lastName = lastName;
        this.fullName = firstName + " " + lastName
    }
}


interface Person {
    firstName: string;
    lastName: string;
}


function greeter(person: Person) {
    return "hello " + person.firstName + " " + person.lastName
}

let user = new User("章三" , "先生")

// var user: Person = {
//     firstName:"章三",
//     lastName: "先生"
// }
console.log(greeter(user))